#ifndef BUTTONITEM_H
#define BUTTONITEM_H

#include "imageitem.h"

class ButtonItem : public ImageItem
{
    Q_OBJECT
public:
    ButtonItem(const QString &imgName,
               const QPoint &leftTop,
               const QPoint &rightBottom,
               QGraphicsScene *scene = 0,
               QGraphicsItem *parent = 0);
    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
    virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
    virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);

    void setFocusing(bool focus);
signals:
    void clicked(ButtonItem *who);
protected:
    bool focused;
};

#endif // BUTTONITEM_H
